package edu.nwpu.zya.coreops.modules.monitor.controller;

import edu.nwpu.zya.coreops.common.utils.R;
import edu.nwpu.zya.coreops.modules.monitor.service.AppMonitorService;
import edu.nwpu.zya.coreops.modules.monitor.vo.AppMonitorVo;
import edu.nwpu.zya.coreops.modules.monitor.vo.EcsMonitorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("monitor/appMonitor")
public class AppMonitorController {
    @Autowired
    private AppMonitorService appMonitorService;

    @RequestMapping("/series")
    public R series(@RequestParam("instanceId")String instanceId, @RequestParam("timePeriod")Integer timePeriod){
        List<AppMonitorVo> series=appMonitorService.getSeriesByIdAndPeriod(instanceId,timePeriod);
        return R.ok().put("series",series);
    }
}
